package com.kasax.httpclient.core.inters;

import com.kasax.httpclient.beans.Request;
import com.kasax.httpclient.beans.Response;
import com.kasax.httpclient.core.HttpCondec;
import com.kasax.httpclient.core.HttpConnection;

import java.io.IOException;

public interface Interceptor {
    // 拦截操作
    public Response intercpt(Chain chain) throws IOException;

    interface Chain {
        Request request();

        // 处理请求
        Response procced() throws IOException;

        Response procced(HttpConnection connection) throws IOException;

        HttpConnection connection();

        Call call();

        int connectTimeoutMillis();

        int readTimeoutMillis();

        int writeTimeoutMillis();

        int callTimeoutMillis();

        HttpCondec httpCodec();
    }
}
